{/* LAYOUT模板 */}
<layout name="layout"/>
{/* LAYOUT模板 */}
{/* import Js,Css */}
<js href="__PUBLIC__/js/admin/listTable.js"/>
<css href="__PUBLIC__/css/admin/admin.css"/>
<css href="__PUBLIC__/css/jquery-ui.css" />
<js href="__PUBLIC__/js/core/jquery-ui.1.10.4.js" />
<js href="__PUBLIC__/js/core/plugins.js"/>
{/* import js,css */}
<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->
<div id="loading"><!--#loading#--></div>

<div class="list-div" id="listDiv">
	<table class="cat-list-table" width="100%" cellspacing="1" cellpadding="2" id="list-table">
		<tr>
			<th>分类名称</th>
			<th>商品数量</th>
			<th>数量单位</th>
			<th>导航栏</th>
			<th>是否显示</th>
			<th>价格分级</th>
			<th>排序</th>
			<th>操作</th>
		</tr>
		<volist name="catList" id="cat">
			<tr align="center" class="" id="{$cat.parent_id}_{$cat.cat_id}">
				<td align="left" class="first-cell" style="background-color: rgb(255, 255, 255);">
					<img src="__IMG__/admin/menu_minus.gif" id="icon_0_1" width="9" height="9" border="0" style="margin-left:0em" onclick="rowClicked(this)">
					<span>
						<a href="__APP__/goods/goods?cat_id={$cat.cat_id}">{$cat.cat_name}</a>
					</span>
				</td>
				<td width="10%" style="background-color: rgb(255, 255, 255);">0</td>
				<td width="10%" style="background-color: rgb(255, 255, 255);">
					<span onclick="listTable.edit(this, 'edit_measure_unit', 1)">{$cat.measure_uint}</span>
				</td>
				<td width="10%" style="background-color: rgb(255, 255, 255);">
					<if condition="$cat['show_in_nav'] eq 1">
						<img src="__IMG__/admin/yes.gif" onclick="listTable.toggle(this, 'toggle_show_in_nav', 1)">
					<else/>
						<img src="__IMG__/admin/no.gif" onclick="listTable.toggle(this, 'toggle_show_in_nav', 0)">
					</if>				
				</td>
				<td width="10%" style="background-color: rgb(255, 255, 255);">
					<if condition="$cat['is_show'] eq 1">
						<img src="__IMG__/admin/yes.gif" onclick="listTable.toggle(this, 'toggle_is_show', 1)">
					<else/>
						<img src="__IMG__/admin/no.gif" onclick="listTable.toggle(this, 'toggle_is_show', 0)">
					</if>
				</td>
				<td style="background-color: rgb(255, 255, 255);">
					<span onclick="listTable.edit(this, 'edit_grade', 1)">{$cat.grade}</span>
				</td>
				<td width="10%" align="right" style="background-color: rgb(255, 255, 255);">
					<span onclick="listTable.edit(this, 'edit_sort_order', 1)">{$cat.sort_order}</span>
				</td>
				<td width="24%" align="center" style="background-color: rgb(255, 255, 255);">
					<a href="__URL__/move_cat?id={$cat.cat_id}">转移商品</a> |
					<a href="__URL__/mod_cat?id={$cat.cat_id};" >编辑</a> |
					<a href="javascript:delete_goodscat('__URL__/del_cat','{$cat.parent_id}','{$cat.cat_id}')" title="移除">移除</a>
				</td>
			</tr>
		</volist>
	</table>
</div>

<script>
/*删除分类*/
function delete_goodscat(url,parent_id,id){
	$.ajax({
		url:url,
		type:'post',
		dataType:'json',
		data:{id:id},
		beforeSend:function(){
			$('#loading').QLoading({text:'删除中...',status:'open'});
		},
		success:function(msg){
			if(msg.data == '1'){
				$('#' + parent_id + '_' +id).remove();
				$('#loading').QLoading({img:'happy',text:msg.info,status:'close',time:1.5});
			}
			else{
				$('#loading').QLoading({img:'sad',text:msg.info,status:'close',time:1.5});
			}
		}
	});
}
</script>





